<template>
  <!-- animate__animated animate__rubberBand -->
  <div class="overlay" v-show="true">
  <div class="modalBox">
    <div class="titleBox">
      <div class="title">
        <span>{{ title }}</span>
        <span>{{ title2 }}</span>
      </div>
      <div class="backBox">
        <div style="cursor: pointer" v-if="CurrentLevel !== 2" @click="backFn1">
          <img src="@/assets/bigScreen/fanhui.png" alt="" />
        </div>
        <div style="cursor: pointer; margin-left: 5px" @click="closeModal">
          <img src="@/assets/bigScreen/guanbi.png" alt="" />
        </div>
      </div>
    </div>
    <div class="contentBox">
      <slot name="customContent"></slot>
    </div>
  </div>
</div>
</template>
<script setup>
import { ref, watch, reactive, onActivated, onUnmounted, onMounted } from 'vue'
import { ElButton, ElIcon } from 'element-plus'
const props = defineProps({
  title: {
    type: String,
    default: '详情',
  },
  title2: {
    type: String,
    default: '',
  },
  CurrentLevel: {
    type: Number,
    default: 1,
  },
})
const emits = defineEmits(['changeModalVisibe', 'backFn'])
const closeModal = () => {
  emits('changeModalVisibe', false)
}
const backFn1 = () => {
  emits('backFn')
}
</script>

<style lang="scss" scoped>
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* 半透明黑色遮罩层 */
  z-index: 999; /* 比弹框的 z-index 小 */
  display: flex;
  justify-content: center;
  align-items: center;
}
.modalBox {
  position: fixed;
  top: 12%;
  // left: calc((100% - 90rem) / 2);
  left: 50%;
  transform: translateX(-50%);
  width: 140rem;
  height: 68rem;
  background: url('@/assets/newHome/sonPage/mask-bg.png') no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  padding: 2.4rem 2.8rem;
  z-index: 1000; /* 弹框的 z-index */
  // overflow: hidden;

  .titleBox {
    width: 100%;
    height: 4rem;
    background: url('@/assets/newHome/sonPage/title-bg.png') no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    font-size: 2rem;
    color: #ffffff;
    // line-height: 4rem;
    padding: 0 0.5rem;
    // border: 1px solid red;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title {
      // border: 1px solid red;
    }
    .backBox {
      display: flex;
    }
    .closeBox {
      position: absolute;
      top: 0;
      right: 0;
      width: 4rem;
      height: 4rem;
      cursor: pointer;
    }
  }

  .contentBox {
    width: 100%;
    height: calc(100% - 6rem);
    margin-top: 2rem;
    overflow-y: scroll;
    // border: 1px solid red;
    .imgBox {
      width: 100%;
      height: 40rem;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .textBox {
      font-size: 1.4rem;
      color: #ffffff;
    }
  }

  .contentBox::-webkit-scrollbar {
    display: none;
  }
}
</style>
